'''
Raid TD - Data Structure Library
Programmer: Oscar Chang
Date: 4/20/2014
'''

#Stack class

class Stack():
    def __init__(self):
        self.items = []

    def peek(self):
        return self.items[-1]

    def push(self, item):
        self.items.append(item)

    def pop(self):
        self.items.pop()

    def size(self):
        return len(self.items)

    def isEmpty(self):
        return self.size() == 0

    def __str__(self):
        temp = ""
        if not self.isEmpty():
            for i in range(self.size()-1, -1, -1):
                temp += str(self.items[i]) + "\n"
        return temp
                
